package com.sss.springcloud.service;

import com.sss.springcloud.common.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author sss
 * @date 2020-03-12 15:02
 **/
@Component
//fallback触发的时机是value中的服务名称宕机了才会触发
@FeignClient(value = "${service-url}",fallback = PaymentServiceImpl.class)
public interface PaymentService {

    @GetMapping("/fallback/payment/get/{id}")
    public Result fallback(@PathVariable("id")Integer id);
}
